﻿using System.Data;
using ET;

namespace DAL
{
    public class MCK_DAL
    {
        private readonly clsConnect cls = new clsConnect();

		#region Getdata
		public DataTable GetData_MCK(string keywords)
		{
			cls.CreateNewSqlCommand();
			cls.AddParameter("@KeyWords", keywords);
			return cls.GetData("sp_MCK_GetData");
		}
        public DataTable GetMaxDate_MCK()
		{
			cls.CreateNewSqlCommand();
            return cls.GetData("sp_MCK_GetMaxDate");
		}
        public DataTable GetCheckInOutDetail(int month, string employees, int shclass)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Month", month);
            cls.AddParameter("@MCK_EnrollNumber", employees);
            cls.AddParameter("@SchClass_ID", shclass);
            return cls.GetData("sp_MCK_CheckInOut_Detail");
        }
        public DataTable GetTimeKeeper(int month, int shclass)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Month", month);
            cls.AddParameter("@SchClass_ID", shclass);
            return cls.GetData("sp_MCK_Get_TimeKeeper");
        }
		#endregion

		#region Insert
		public bool Insert_MCK(MCK_ET data)
		{
			cls.CreateNewSqlCommand();
			cls.AddParameter("@MCK_EnrollNumber", data.MCK_EnrollNumber);
			cls.AddParameter("@MCK_Date", data.MCK_Date);
			return cls.ExecuteNonQuery("sp_MCK_Insert");
		}
		#endregion
    }
}